﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
namespace DAL
{
    public class ChiTietPhieuNhap_DAO
    {
        clsDocSQL m_clsDocSQL = new clsDocSQL();
        public int ThemChiTietPhieuNhap(ChiTietPhieuNhap_DTO dto)
        {
            SqlParameter[] m_SqlParameter = new SqlParameter[5];
            m_SqlParameter[0] = new SqlParameter("@MaPhieuNhap", dto.Str_MaPhieuNhap);
            m_SqlParameter[1] = new SqlParameter("@MaSach", dto.Str_MaSach);
            m_SqlParameter[2] = new SqlParameter("@SoLuong", dto.I_SoLuong);
            m_SqlParameter[3] = new SqlParameter("@MaNCC", dto.Str_MaNCC);
            m_SqlParameter[4] = new SqlParameter("@KQ", 0);
            m_SqlParameter[4].Direction = ParameterDirection.Output;
            int KQ = m_clsDocSQL.Insert_Delete_Update("sp_ChiTietThemPN", m_SqlParameter);
            return KQ;
        }
    }
}
